#! /usr/bin/env python3
# _*_coding:utf-8 _*_
__author__ = "Gao"
from django.urls import path,re_path

from my_rest.views import MyObtainJSONWebToken,MyRefreshJSONWebToken,ChangePassword
from api import views


urlpatterns = [
    path('auth/login/', MyObtainJSONWebToken.as_view()),  # 登录，获取token
    path('auth/token-refresh/', MyRefreshJSONWebToken.as_view()),    # 刷新token
    re_path(r'auth/changepassword/(?P<pk>[0-9]+)/$', ChangePassword.as_view()),    # 修改用户密码
    path('overview/', views.Overview.as_view()),    # 库存总览
    path('operation-records/', views.OperationRecordList.as_view()),    # 操作记录
    path('management/stock-list/', views.StockList.as_view()),    # 后台查看所有库存
    re_path(r'management/stock-list/(?P<pk>[0-9]+)/$', views.StockDetail.as_view()),    # 后台修改、删除库存
    path('management/user-list/', views.UserList.as_view()),    # 后台查看所有用户
    re_path(r'management/user-list/(?P<pk>[0-9]+)/$', views.UserDetail.as_view()),    # 后台修改、删除用户
    re_path(r'management/resetpassword/(?P<pk>[0-9]+)/$', views.ResetPassword.as_view()),    # 后台重置用户密码
    path('test/', views.Test.as_view()),
]

# urlpatterns = format_suffix_patterns(urlpatterns)